<script type="text/javascript">
{literal}
function toggleStatus(obj, urlValue) {
	$(obj).attr('disabled', 'disabled');
	$.ajax({
		url: urlValue ,
		type:'GET',
		success: function(){
			$(obj).removeAttr('disabled');
		}
	});
}
{/literal}
</script>
<h1>Filtr przekleństw</h1>

<table cellspacing="0" cellpadding="0" border="0">
	<tr class="selAllRow">
		<td class="cornerTop"></td><td colspan="5"><a href="#" class="selAll">Zaznacz wszystkie</a> <a href="{url Apps=AjaxRemove}" title="Czy na pewno chcesz usunąć aplikację?" class="callAll">usuń</a></td>
	</tr>
	<tr>
		<td class="selAll">&nbsp;</td>
		<th><div style="float:left; width:100%">Lp.</div></th>
		<th>{tables type='label' label='słowo' tid=$table_type o='word'}</th>
		<th>{tables type="label" label='aktywne' tid=$table_type o='active'}</th>
		<th class="noSort"><a href="{url BadWords='Add'}" class="add">Dodaj</a> </th>
	</tr>
	{foreach from=$list item='obj' name=list}
		<tr>
			<td class="selAll"><input name="objs[]" value="{$obj->getId()}" id="remove_{$obj->getId()}" type="checkbox" /></td>
			<td>{tables type='lp' tid=$table_type iteration=$smarty.foreach.list.iteration}</td>
			<td>{$obj->GetWord()|truncate:40:'...'}</td>
			<td>
				<input type="checkbox" {if $obj->getActive() == 1}checked="checked"{/if} onchange="toggleStatus(this, '{url BadWords=ToggleStatus id=$obj->getId()}');"/>
			</td>
			<td><a href="{url BadWords=Edit id=$obj->getId()}" class="edit">edytuj</a><a href="{url Dictionary=AjaxRemove}" title="Czy na pewno chcesz usunąć tłumaczenie?" class="delete callElement">usuń</a></td>
		</tr>
	{foreachelse}
		<tr>
			<td class="selAll"></td><td colspan="{$colspan}" style="text-align: center; font-weight: bolder;">Lista jest pusta</td>
		</tr>
	{/foreach}

	<tr class="selAllRow">
		<td class="cornerBottom"></td>
		<td colspan="{$colspan}">
			<a href="#" class="selAll">Zaznacz wszystkie</a> <a href="{url Dictionary=AjaxRemove}" title="Czy na pewno chcesz usunąć tłumaczenia?" class="callAll" onclick="return false;">usuń</a>
			<div class="pager">
				{tables type='on_page' tid=$table_type}
				{tables type='pagination' tid=$table_type all_count=$c}
			</div>
		</td>
	</tr>
</table>
